package com.ruoyi.web.controller.spoken;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.SpokenBaseSet;
import com.ruoyi.system.service.ISpokenBaseSetService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(value = "/baseSet", description = "基础设置")
@RequestMapping("/spoken/baseSet")
@RestController
public class BaseSetController extends BaseController {

    @Autowired
    ISpokenBaseSetService baseSetService;

    @ApiOperation("根据类型查询设置详情")
    @GetMapping("{bsType}")
    public AjaxResult getInfo(@PathVariable Integer bsType){
        return AjaxResult.success(baseSetService.getInfo(bsType));
    }

    @ApiOperation("修改设置")
    @PutMapping
    public AjaxResult edit(@RequestBody SpokenBaseSet baseSet){
        return AjaxResult.success(baseSetService.update(baseSet));
    }

}
